package org.example.zsfmybatis.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.example.zsfmybatis.model.User;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Insert("insert into user (user_id,name,email,password,points,created_at,updated_at)values" +
            "(#{id},#{name},#{email},#{password},#{points},now(),now())")
    void add(User user);
    @Select("select * from user where user_id=#{id}")
    User getUser(String id);
    @Update("update user set user_id=#{id},name=#{name},email=#{email},points=#{points} where user_id=#{id}")
    void update(User user);
    @Delete("delete from user where user_id=#{id}")
    void delete(User user);
}
